package com.hsy.crm.web.web.basics;

import com.hsy.crm.web.domain.cm.Response;
import com.hsy.crm.web.domain.entity.VendorType;
import com.hsy.crm.web.domain.vo.vendorType.VendorTypeSelectVo;
import com.hsy.crm.web.service.impl.VendorTypeService;
import com.hsy.crm.web.web.BaseAction;
import com.hsy.crm.web.domain.cm.Response;
import com.hsy.crm.web.domain.entity.VendorType;
import com.hsy.crm.web.domain.vo.vendorType.VendorTypeSelectVo;
import com.hsy.crm.web.web.BaseAction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/vendorType")
public class VendorTypeAction extends BaseAction {

    @Autowired
    VendorTypeService vendorTypeService;

    @RequestMapping("/insert")
    public String insert(VendorType vendorType) {
        return Response.body(vendorTypeService.insertVendorType(vendorType));
    }

    @RequestMapping("/update")
    public String update(VendorType vendorType) {
        return Response.body(vendorTypeService.updateVendorType(vendorType));
    }

    @RequestMapping("/delete")
    public String delete(VendorType vendorType) {
        return Response.body(vendorTypeService.deleteVendorType(vendorType));
    }

    @RequestMapping("/select")
    public String select(VendorTypeSelectVo vendorTypeSelectVo) {
        return Response.body(vendorTypeService.find(vendorTypeSelectVo));
    }

    @RequestMapping("/get")
    public String get(VendorType vendorType) {
        return Response.body(vendorTypeService.selectOne(vendorType));
    }

}
